package com.aurora.spider.site.usatoday;

import com.geccocrawler.gecco.annotation.PipelineName;
import com.geccocrawler.gecco.pipeline.Pipeline;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * Created by jackie on 18/1/15.
 */
@PipelineName("usatodaySearchDealLine")
@Component
@Slf4j
public class UsatodaySearchDealLine implements Pipeline<UsatodaySearch> , ApplicationContextAware {

    private static ApplicationContext applicationContext;
    @Override
    public void process(UsatodaySearch search) {
        applicationContext.publishEvent(new UsatodayEvent(search));
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext=applicationContext;
    }
}
